package com.kamistoat.meimeichat.meimeichatserverapplication.kcp;

import com.kamistoat.meimeichatserveraggrement.codec.ObjDecoder;
import com.kamistoat.meimeichatserveraggrement.codec.ObjEncoder;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.DatagramChannel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class KcpNettyServerChannelInitializer extends ChannelInitializer<DatagramChannel> {

    @Autowired
    P2PDatagramHandlerServer p2PDatagramHandlerServer;

    @Override
    protected void initChannel(DatagramChannel datagramChannel) throws Exception {
        datagramChannel.pipeline().addLast(p2PDatagramHandlerServer);
    }
}
